import Router from '@koa/router';
import * as backupController from '../controllers/backup.controller';
import { authMiddleware, adminMiddleware } from '../middleware/auth';

const router = new Router({
  prefix: '/api/backups',
});

// 所有路由都需要认证和管理员权限
router.use(authMiddleware);
router.use(adminMiddleware);

// 创建备份
router.post('/create', backupController.createBackup);

// 删除备份
router.post('/delete', backupController.deleteBackup);

// 查询备份列表
router.post('/list', backupController.getBackupList);

// 下载备份文件
router.post('/download', backupController.downloadBackup);

export default router;

